// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1

Rectangle {
    id: toolBar
    height: 80
    width: parent.width
    anchors.left: parent.left

    gradient: Gradient {
        GradientStop { position: 0; color: "#919191" }
        GradientStop { position: 1; color: "#666666" }
    }

    property int pauseAnim: 0
    property int durationAnim: 400

    function show() {
        toolBar.state = "normal"
    }

    function hide() {
        toolBar.state = "hide"
    }

    states: [
        State {
            name: "normal"
            AnchorChanges {
                target: toolBar
                anchors.bottom: parent.bottom
            }
        },
        State {
            name: "hide"
            AnchorChanges {
                target: toolBar
                anchors.top: parent.bottom
            }
        }
    ]
    transitions: Transition {
        SequentialAnimation {
            PauseAnimation { duration: toolBar.pauseAnim }
            AnchorAnimation { duration: toolBar.durationAnim; easing.type: Easing.OutElastic }
        }
    }

    state: "hide"

    Component.onCompleted: toolBar.state = "normal"
}
